Param(
[string]$server='FIBICH-ACER\SQLEXPRESS',
[string]$db='CensusData',
[string]$userName="",
[string]$password="",
[string]$schema='ACSSF',
[string]$table='Summary_File_0001',
[string]$inputFile="ACSSF\e20131va0001000.txt",
[string]$formatFile="ACSSF_Summary_File_0001.fmt"
)

$exe ="bcp";
$FQTN=$db+'.'+$schema+'.'+$table;
$direction='in';
$serverNameFlag='-S';
$authenticationFlag='-T';
$userNameFlag="-U";
$passwordFlag="-P";
$formatFlag="-f";
$batchFlag="-b";
$batchSize="10000";

if ($userName -eq "") {
	$string="$exe $FQTN $direction $inputFile $serverNameFlag $server $authenticationFlag $formatFlag $formatFile $batchFlag $batchSize ";
}
else {
	$string="$exe $FQTN $direction $inputFile $serverNameFlag `"$server`" $userNameFlag $userName $passwordFlag $password $formatFlag $formatFile $batchFlag $batchSize ";
};

write-host $string;
invoke-expression $string;